package geo.com.geosdkdemo.view.adapter;

/*
 * author: caojunhao
 * date  : 2020/6/9
 * desc  :
 */

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;

import java.util.List;

import geo.com.geosdkdemo.R;


public class DebugCommandRecycleviewAdapter extends RecyclerView.Adapter<DebugCommandRecycleviewAdapter.ViewHolder> {

    private List<String> mList;
    public DebugCommandRecycleviewAdapter(List<String> list) {
        this.mList = list;
    }

    @Override

    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_debug_command_item, parent, false);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        String command = mList.get(position);
        holder.tvCommand.setText(command);
    }

    @Override
    public int getItemCount() {
        return mList.size();
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        EditText tvCommand;
        public ViewHolder(View view) {
            super(view);
            tvCommand=view.findViewById(R.id.tv_command);
        }
    }

}
